
********************************************************************************
** Generate IOtable With Intensities
********************************************************************************

tempfile price_clean
quietly save `price_clean'

* calculate indirect price
rename naics naics_row
keep naics_row change_p spec
duplicates drop
joinby naics_row using "$IO/IO_energyintensity_lite.dta"

gen change_p_ind = io_v_norm*change_p
collapse (sum) change_p_ind, by(naics spec)

* merge in direct price
merge 1:1 naics spec using `price_clean', keepusing(change_p shipments) nogen keep(match)

//AND THAT SHOULD BE THAT!
label var change_p_ind "indirect price change, $ per mi"
